import os
import shutil

wav_home="/home/wang/codes/py/VC/VCTK/Dataset/VCTK-Corpus/wav48_silence_trimmed"
text_home="/home/wang/codes/py/VC/VCTK/Dataset/VCTK-Corpus/txt"

target_wav_home="/home/wang/codes/py/VC/VCTK/Wenet_Test/wav/test"
target_text_home="/home/wang/codes/py/VC/VCTK/Wenet_Test/transcript"

for dir_home in sorted(os.listdir(wav_home))[:-1]:
    for wav_name in os.listdir(os.path.join(wav_home,dir_home)):
        
        if(wav_name.endswith("mic1.flac")):
            print(wav_name)
            old_path=os.path.join(os.path.join(wav_home,dir_home),wav_name)
            new_path=os.path.join(target_wav_home,wav_name[:8]+".wav")
            print("o",old_path)
            print('n',new_path)
            shutil.copyfile(old_path, new_path)
